<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
<script>
    //面向对象思想
    //表现力的JSON 对象字面量
    //let 变量，关键字，保留字
    //key:value 键值对
    let a = {
        name:'张三',//字符串 string
        age:18,//数值 number 不适合计算
        sex:'男',//字符串 string
        hobby:['篮球','足球','跑步'],//对象 array
        isSingle:true,//布尔值 boolean
        job: null,//空值 null
        sendFlower: function(target){
            target.receiveFlower(a);
        }
    }
    let b;//未定义 undefined
    let c ={
        xq: 30,
        name:'小美',
        hometown:'赣州',
        receiveFlower: function(sender){
            console.log('小美收到了'+sender.name+'的一个花');
            if(this.xq <80){
                console.log('小美拒绝了');
            }else{
                console.log('小美同意了');
            }
        }
    }
    let d ={
        name:'小红',
        hometown:'上饶',
        receiveFlower: function(sender){
            setTimeout(()=>{
                c.xq = 90;
                c.receiveFlower(sender);
            },3000);
            // console.log('小红收到了'+sender.name+'的一个花');
            // c.receiveFlower(sender);
            // if(sender.name === '张三'){
            //     console.log('小红拒绝了');
            // }

        }
    }
    // a.sendFlower(c);
    // c.receiveFlower(a);
</script>
</body>
</html>